package com.sservice.service.service;

import com.sservice.model.entity.PurchaseOrder;
import com.sservice.model.vo.PurchaseOrderVo;

import java.math.BigDecimal;
import java.util.List;

public interface PurchaseOrderService {
    int deleteByPrimaryKey(Integer id);

    int insert(PurchaseOrder record);

    int insertSelective(PurchaseOrder record);

    /**
     * 创建订单
     *
     * @param record
     * @return
     */
    Object createOrder(PurchaseOrder record);

    PurchaseOrder selectByPrimaryKey(Integer id);

    /**
     * 强制执行完毕订单
     *
     * @param po
     * @return
     */
    Object forceEnd(PurchaseOrder po);

    int updateByPrimaryKeySelective(PurchaseOrder record);

    /**
     * 修改包含订单价格
     *
     * @param record
     * @return
     */
    Object updateWidthPrice(PurchaseOrder record);

    int updateByPrimaryKey(PurchaseOrder record);

    int queryCount(PurchaseOrderVo record);

    int queryCurrentMonthCount();

    List<PurchaseOrderVo> queryByPage(PurchaseOrderVo record);

    /**
     * 统计某一采购单的订单量
     *
     * @param record 采购单-purchaseId表示
     * @return
     */
    int countByPurchaseId(PurchaseOrder record);

    /***
     * 采购订单数量变化
     * @param id
     * @param receiving
     * @param received
     * @return
     */
    int changeNumber(Integer id, BigDecimal receiving, BigDecimal received);

    /**
     *
     * @param id
     * @param applying 审核金额
     * @param actual 实际付款金额
     * @return
     */
    int changeMoney(Integer id, BigDecimal applying, BigDecimal actual);
}